package com.xg.frame.components;

import org.springframework.stereotype.Component;
import org.thymeleaf.dialect.AbstractProcessorDialect;
import org.thymeleaf.processor.IProcessor;
import org.thymeleaf.standard.StandardDialect;

import javax.annotation.Resource;
import java.util.HashSet;
import java.util.Set;

/**
 * @author tzt
 * @date Created in 2021/8/11 14:04
 * @description：自定义组件配置类
 * @modified By：
 */
@Component
public class CustomComponents extends AbstractProcessorDialect {
    @Resource
    private SqSelect sqSelect;
    /**
     * 定义方言名称
     */
    private static final String NAME="系统自定义标签";
    /**
     * 定义方言属性
     */
    static final String PREFIX="sq";

    protected CustomComponents() {
        super(NAME, PREFIX, StandardDialect.PROCESSOR_PRECEDENCE);
    }


    @Override
    public Set<IProcessor> getProcessors(String dialectPrefix) {
        final Set<IProcessor> processor=new HashSet<>();
        //<sq:select>标签
        processor.add(sqSelect);
        return processor;
    }
}
